package com.twu.biblioteca.model;

/**
 * @author Aaron Edwards
 * @since 24/09/13
 */
public class Book implements Comparable<Book> {

    private String bookTitle;
    private User reservedBy;

    public Book(String bookTitle) {
        this.bookTitle = bookTitle;
    }

    public String getBookTitle() {
        return bookTitle;
    }

    public boolean isReserved() {
        return reservedBy != null;
    }

    public void setReservedBy(User reservedBy) {
        this.reservedBy = reservedBy;
    }

    @Override
    public int compareTo(Book other) {
        return getBookTitle().compareTo(other.getBookTitle());
    }

    public String getDisplayString() {
        return bookTitle;
    }

    public User getReservedBy() {
        return reservedBy;
    }
}
